const express = require('express')
const webpack = require('webpack')
const webpackMiddleware = require('webpack-dev-middleware')
const config = require('./webpack.config.base')

const PORT = 9999
const app = express()

app.use(webpackMiddleware(webpack(config)))

app.get('*', (_, res) => {
  res.sendFile(__dirname + '/index.html')
})

app.listen(PORT)
